package com.mini.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mini.config.EncryptField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author shixiaopeng  on 2020/12/22
 */
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@DynamicUpdate
@DynamicInsert
public class BusinessChanceCallRecord implements Serializable{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "机会id")
    private Long chanceId;

    @ApiModelProperty(value = "通道ID")
    private String channelId;

    @ApiModelProperty(value = "运营专员ID")
    private Long userId;

    @ApiModelProperty(value = "主叫号码")
    private String caller;

    @ApiModelProperty(value = "被叫号码")
    @EncryptField
    private String callee;

    @ApiModelProperty(value = "电话接通时间")
    private String startTime;

    @ApiModelProperty(value = "电话挂断时间")
    private String endTime;

    @ApiModelProperty(value = "通话时长")
    private Integer duration;

    @ApiModelProperty(value = "响铃时间")
    private String ringTime;

    @ApiModelProperty(value = "响铃时长")
    private Integer ringTimeLen;

    @ApiModelProperty(value = "呼叫类型")
    private String alicomRtcType;

    @ApiModelProperty(value = "录音文件URL")
    private String recordFile;

    @ApiModelProperty(value = "oss录音地址")
    private String localRecordFile;

    @ApiModelProperty(value = "通话备注")
    private String callDesc;

    @ApiModelProperty(value = "接听状态 0-未接通 1-已接通")
    private Integer answerStatus;

    @ApiModelProperty(value = "sku标识")
    private Long skuId;

    @ApiModelProperty(value = "呼叫记录ID")
    private String callId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "产品类型 A-阿里 T-腾讯")
    private String productCode;
}
